﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

using LowLevelGraphics;

namespace LowLevelGraphics.Drawing.FloodFillModes
{
    /// <summary>
    /// interface for flood filling
    /// </summary>
    public interface IFill
    {
        /// <summary>
        /// Fills the specified _bitmap.
        /// </summary>
        /// <param name="_bitmap">The _bitmap.</param>
        /// <param name="_nX">The _n X.</param>
        /// <param name="_nY">The _n Y.</param>
        /// <param name="_color">The _color.</param>
        void Fill(UnsafeBitmap _bitmap, int _nX, int _nY, Color _color);
    }

    /// <summary>
    /// Abstract base class for flood filling
    /// </summary>
    public abstract class AbstractFloodFill : IFill, ICloneable
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AbstractFloodFill"/> class.
        /// </summary>
        public AbstractFloodFill()
        {
        }

        #region IFill Members

        /// <summary>
        /// Fills the specified _bitmap.
        /// </summary>
        /// <param name="_bitmap">The _bitmap.</param>
        /// <param name="_nX">The _n X.</param>
        /// <param name="_nY">The _n Y.</param>
        /// <param name="_color">The _color.</param>
        public abstract void Fill(UnsafeBitmap _bitmap, int _nX, int _nY, Color _color);

        #endregion 

        #region ICloneable Members

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public abstract object Clone();

        #endregion
    }
}
